// npm install svgexport -g
const { exec } = require("child_process");
const { readdir } = require("node:fs/promises");

const main = async (dir) => {
  try {
    const files = await readdir(dir);
    for (const file of files) {
      const cmd = `svgexport ${file} ${file.slice(0, -4)}.png`;
      console.log("TT > main > cmd:", cmd);
      exec(cmd, {
        cwd: dir,
      });
    }
  } catch (err) {
    console.error(err);
  }
};

main("D:\\1项目资料\\02_openIm\\3_IM集成会见\\切图\\IM新架构\\3 Tab\\");
